<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('sub_name')->nullable();
            $table->text('slogan')->nullable();
            $table->string('img')->nullable();
            $table->decimal('price',8,0)->default(0);
            $table->decimal('market_price',8,0)->default(0);
            $table->integer('sales')->default(0);
            $table->integer('sales_fake')->default(0);
            $table->integer('stock')->default(0);
            $table->integer('sort')->default(0);
            $table->text('picture')->nullable();
            $table->longText('describe')->nullable();
            $table->tinyInteger('status')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
